<?php
/**
 * 产品评论后台管理栏目首页文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	comments
 */
$intcommentsuserID=$_SESSION['user_id'];
if (is_object($objWebInit)) {
		if(!isset($objcomments)){	
		include_once(__WEB_ROOT."/comments/class/comments.class.php");
		include_once(__WEB_ROOT."/comments/config/var.inc.php");
		$objcomments = new comments();
		$objcomments->setDBG($arrGPdoDB);
		$objcomments->arrGPage = $arrGPage;
		if(is_object($objWebInit->db)) $objcomments->db = $objWebInit->db;
		else $objcomments->db();
		
		if (empty($_GET['page'])) {
			$intPage = 1 ;
		} else {
			$intPage = intval($_GET['page']);
		}
		$arrWhere = array();
		$arrLink = array();
		$arrWhere[] = "pass='1'";

		$intcommentsID = intval($_GET['id']);
		$arrcommentsTop = array();
		$arrcommentsTop = $objcomments->getInfoList("where state = 1 and pass = 1 and user_id=$intcommentsuserID",' order by submit_date desc',true);
		
		$intRows = $arrcommentsTop['COUNT_ROWS'];
		unset($arrcommentsTop['COUNT_ROWS']);


		//静态url处理
		$strLink = '';
		if($arrGWeb['URL_static']){
			if (!empty($arrLink)) $strLink = str_replace('=','-',implode('-',$arrLink));
		}else{
			if (!empty($arrLink)) $strLink = implode('&',$arrLink);
		}

	//翻页跳转link
	$strPage= $objcomments->makeInfoListPage($intRows,$strLink,$link_type=$arrGWeb['URL_static']);

	// 输出到模板
	$arrMOutput["smarty_assign"]['strPage'] = $strPage;
	$arrMOutput["smarty_assign"]['arrcommentsTop'] = $arrcommentsTop;
	}
}
?>